package com.netsdk.config.json;

import com.alibaba.fastjson.JSON;
import com.netsdk.dto.EnterDTO;

import javax.websocket.DecodeException;
import javax.websocket.Decoder;
import javax.websocket.EndpointConfig;

/**
 * @Author aqie
 * @Date 2022/3/26 12:58
 * @desc
 */
public class EnterDecoder  implements Decoder.Text<EnterDTO>{
    @Override
    public EnterDTO decode(String enter) throws DecodeException {
        return JSON.parseObject(enter, EnterDTO.class);
    }

    @Override
    public boolean willDecode(String s) {
        return true;
    }

    @Override
    public void init(EndpointConfig endpointConfig) {

    }

    @Override
    public void destroy() {

    }
}
